home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_IIACSSMN.ASP < prev    next >
Encoding:
Text File  |  1999-06-03  |  7.6 KB  |  317 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3. <!-- #include file="directives.inc" -->
  4.  
  5. <% if Session("FONTSIZE") = "" then %>
  6.     <!--#include file="iito.inc"-->
  7. <% else %>
  8.     <!--#include file="iiacsshd.str"-->
  9. <% 
  10.  
  11. On Error Resume Next  
  12.  
  13. Dim path, currentobj, ipsecobj
  14.  
  15. path=Session("dpath")
  16. Session("path")=path
  17. Set currentobj=GetObject(path)
  18. Set ipsecobj=currentobj.IPSecurity 
  19.  
  20. Session("SpecObj")="IPSecurity"
  21. Session("SpecProps")="GrantbyDefault,IPDeny,IPGrant,DomainGrant,DomainDeny"
  22. %>
  23.  
  24. <!--#include file="iiset.inc"-->
  25. <!--#include file="iisetfnt.inc"-->
  26. <%
  27.     ' Do not use top.title.Global.update flag if page is loaded into a dialog
  28.     bUpdateGlobal = false
  29. %>
  30. <!--#include file="iiaspstr.inc"-->
  31.  
  32. <HTML>
  33. <SCRIPT LANGUAGE="JavaScript">
  34.     function SetBool(){
  35.         if (document.userform.rdoGrantbyDefault[0].checked){
  36.             document.userform.GrantbyDefault.value="True"
  37.         }
  38.         else{
  39.             document.userform.GrantbyDefault.value="False"
  40.         }
  41.         loadList();
  42.     }
  43. </SCRIPT>
  44.  
  45. <BODY BGCOLOR="<%= Session("BGCOLOR") %>" LINK="#000000" VLINK="#000000" ALINK="navy" LEFTMARGIN=5 TOPMARGIN=5 onLoad="loadList();loadHelp();">
  46.  
  47. <FORM NAME="userform">
  48.  
  49. <TABLE CELLSPACING=0 CELLPADDING=2>
  50. <TR><TD  ><%= sFont("","","",True) %><B><%= L_TCPRESTRICT_TEXT %></B></FONT></TD></TR>
  51. <TR><TD>
  52. <BLOCKQUOTE>
  53. <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=2>
  54.     <TR>
  55.         <TD VALIGN="top"  >
  56.             <%= sFont("","","",True) %>
  57.                     <%= L_BYDEFAULT_TEXT %>
  58.             </FONT>
  59.         </TD>
  60.         <TD VALIGN="top"  >
  61.             <TABLE>
  62.                 <TR>
  63.                     <TD>
  64.                         <%= sFont("","","",True) %>
  65.                             <IMG SRC="images/smallkey.gif" WIDTH=17 HEIGHT=18 BORDER=0 ALIGN="middle">
  66.                         </FONT>
  67.                     </TD>
  68.                     <TD>
  69.                         <%= sFont("","","",True) %>
  70.                         <% if ipsecobj.GrantbyDefault then %>
  71.                             <INPUT TYPE="hidden" NAME="GrantbyDefault" VALUE="True">
  72.                             <INPUT TYPE="radio" NAME="rdoGrantbyDefault" CHECKED OnClick="SetBool();">
  73.                         <% else %>
  74.                             <INPUT TYPE="hidden" NAME="GrantbyDefault" VALUE="False">
  75.                             <INPUT TYPE="radio" NAME="rdoGrantbyDefault" OnClick="SetBool();">
  76.                         <% end if %>
  77.                         </FONT>
  78.                     </TD>
  79.                     <TD>
  80.                         <%= sFont("","","",True) %>                    
  81.                             <%= L_GRANTED_TEXT %>
  82.                         </FONT>
  83.                     </TD>
  84.                 </TR>
  85.                 
  86.                 <TR>
  87.                     <TD>
  88.                         <%= sFont("","","",True) %>
  89.                             <IMG SRC="images/lock.gif" WIDTH=16 HEIGHT=18 BORDER=0 ALIGN="middle">
  90.                         </FONT>
  91.                     </TD>
  92.                     <TD>
  93.                         <%= sFont("","","",True) %>
  94.                         <% if ipsecobj.GrantbyDefault then %>
  95.                             <INPUT TYPE="radio" NAME="rdoGrantbyDefault" OnClick="SetBool();">
  96.                         <% else %>
  97.                             <INPUT TYPE="radio" NAME="rdoGrantbyDefault" CHECKED OnClick="SetBool();">
  98.                         <% end if %>
  99.                         </FONT>
  100.                     </TD>
  101.                     <TD>
  102.                         <%= sFont("","","",True) %>                    
  103.                             <%= L_DENIED_TEXT %>
  104.                         </FONT>
  105.                     </TD>
  106.                 </TR>                                
  107.             </TABLE>
  108.         </TD>
  109.     </TR>
  110.     
  111.     <TR>
  112.         <TD  ><%= sFont("","","",True) %><%= L_EXCEPTBELOW_TEXT %></FONT></TD>
  113.     </TR>
  114. </TABLE>
  115. </BLOCKQUOTE>
  116. </TD></TR>
  117. </TABLE>
  118.  
  119. </FORM>
  120.  
  121. <SCRIPT LANGUAGE="JavaScript">
  122.  
  123.     <!--#include file="iijsfuncs.inc"-->
  124.     <!--#include file="iijsls.inc"-->
  125.     
  126.     function loadHelp(){
  127.         top.title.Global.helpFileName="iipy_4";
  128.     }
  129.  
  130.     function SetList(){
  131.     }
  132.  
  133.     function disableDefault(dir,fromCntrl, toCntrl){
  134.         if (!dir){
  135.             if (fromCntrl.value !=""){
  136.                 toCntrl.value=fromCntrl.value;
  137.                 fromCntrl.value="";
  138.             }
  139.         }
  140.         else{
  141.             if (toCntrl.value !=""){
  142.                 fromCntrl.value=toCntrl.value;
  143.                 toCntrl.value="";
  144.             }
  145.         }
  146.     }
  147.  
  148.     function enableDefault(chkCntrl){
  149.         chkCntrl.checked=true;
  150.     }
  151.  
  152.  
  153.  
  154.     function loadList(){
  155.         parent.list.location="iiacssls.asp";
  156.     }
  157.  
  158.  
  159.     function buildListForm(){
  160.         numrows=0;
  161.         for (var i=0; i < cachedList.length; i++) {
  162.             fullstr = cachedList[i].ip + cachedList[i].Subnet+ cachedList[i].domain;
  163.             if ((!cachedList[i].deleted) && (fullstr !="")){
  164.                 numrows=numrows + 1;
  165.             }
  166.         }
  167.         qstr="numrows="+numrows;
  168.         qstr=qstr+"&cols=IPGrant&cols=IPDeny&cols=DomainGrant&cols=DomainDeny"
  169.  
  170.         top.hlist.location.href="iihdn.asp?"+qstr;
  171.         <% 'the list values will be grabbed by the hiddenlistform script... %>
  172.  
  173.  
  174.     }
  175.  
  176.     function SetListVals(){
  177.         listForm=top.hlist.document.hiddenlistform;
  178.         j=0;
  179.         for (var i=0; i < cachedList.length; i++) {
  180.  
  181.             fullstr = cachedList[i].ip + cachedList[i].Subnet+ cachedList[i].domain;
  182.             if ((!cachedList[i].deleted) && (fullstr !="")){
  183.                 ipSubnet=cachedList[i].ip + "," + cachedList[i].Subnet; 
  184.                 if (ipSubnet==","){
  185.                     ipSubnet=""
  186.                 }
  187.                 else{
  188.                 //if there is no subnet, set it to default...
  189.                     if (ipSubnet.indexOf(",") == ipSubnet.length-1){
  190.                         ipSubnet = ipSubnet + "255.255.255.255"
  191.                     }
  192.                 }
  193.                 if (cachedList[i].access){    
  194.                     // this works because on entry, if the user enters a domain, the ip/Subnet will be cleared. 
  195.                     // if they enter an ip the domain will be cleared.
  196.                     // ip/Subnet and domain should be mutually exclusive...
  197.  
  198.                     listForm.elements[j++].value=ipSubnet;
  199.                     listForm.elements[j++].value="";
  200.                     listForm.elements[j++].value=cachedList[i].domain;
  201.                     listForm.elements[j++].value="";
  202.                 }
  203.                 else{
  204.                     listForm.elements[j++].value="";
  205.                     listForm.elements[j++].value=ipSubnet;
  206.                     listForm.elements[j++].value="";
  207.                     listForm.elements[j++].value=cachedList[i].domain;
  208.                 }
  209.             }
  210.             cachedList[i].updated=false; 
  211.         }
  212.     }
  213.  
  214.     function listObj(i,a,ip,s,dmn){
  215.         this.id = i;
  216.         
  217.         this.deleted=false;
  218.         this.updated=false;
  219.         this.newitem=false;
  220.  
  221.         if (a == null)
  222.         {
  223.             if (document.userform != null)
  224.             {
  225.                 a = !document.userform.rdoGrantbyDefault[0].checked;
  226.             }
  227.             else
  228.             {
  229.                 a = false;
  230.             }
  231.         }
  232.         
  233.         this.access=initParam(a,"");
  234.         this.ip=initParam(ip,"");
  235.         this.Subnet=initParam(s,"");
  236.         this.domain=initParam(dmn,"");
  237.     }
  238.     
  239.     listFunc=new listFuncs("ip","",top.opener.top);
  240.     cachedList=new Array()
  241.  
  242. <%  
  243.         Dim agrantlist, arraybound, aAccess, i, Nexti
  244.         Dim agrantDomains, adenylist, adenyDomains
  245.         
  246.         agrantlist=ipsecobj.IPGrant
  247.         if IsArray(agrantlist) then
  248.             arraybound=UBound(agrantlist)
  249.             if agrantlist(0) <> "" then
  250.             for i=0 to arraybound
  251.                 aAccess=getIP(agrantlist(i))
  252.                  %>cachedList[<%= i %>]=new listObj(<%= i %>, true, "<%= aAccess(0) %>","<%= aAccess(1) %>","");<%  
  253.             Next
  254.             end if 
  255.         end if
  256.  
  257.         Nexti=UBound(agrantlist)+1
  258.         agrantdomains=ipsecobj.DomainGrant        
  259.         if IsArray(agrantdomains) then        
  260.             arraybound=UBound(agrantdomains)
  261.             if agrantdomains(0) <> "" then
  262.             for i=0 to arraybound
  263.                  %>cachedList[<%= Nexti %>]=new listObj(<%= Nexti %>, true, "","","<%= sJSLiteral(agrantdomains(i)) %>");<%  
  264.                 Nexti=Nexti + 1
  265.             Next
  266.             end if
  267.         end if
  268.  
  269.         adenylist=ipsecobj.IPDeny    
  270.         if IsArray(adenylist) then
  271.             arraybound=UBound(adenylist)
  272.             if adenylist(0) <> "" then                    
  273.             for i=0 to arraybound
  274.                 aAccess=getIP(adenylist(i))
  275.                  %>cachedList[<%= Nexti %>]=new listObj(<%= Nexti %>, false, "<%= aAccess(0) %>","<%= aAccess(1) %>","");<%  
  276.                 Nexti=Nexti + 1
  277.             Next
  278.             end if 
  279.         end if
  280.  
  281.         adenydomains=ipsecobj.DomainDeny
  282.         if IsArray(adenydomains) then
  283.             arraybound=UBound(adenydomains)        
  284.             if adenydomains(0) <> "" then            
  285.             for i=0 to arraybound
  286.                  %>cachedList[<%= Nexti %>]=new listObj(<%= Nexti %>, false, "","","<%= sJSLiteral(adenydomains(i)) %>");<%  
  287.                 Nexti=Nexti + 1
  288.             Next
  289.             end if
  290.         end if
  291.  
  292. function getIP(bindstr)
  293.     
  294.     dim one, ip, sn
  295.  
  296.     one=Instr(bindstr,",")
  297.     if one > 0 then
  298.         ip=Trim(Mid(bindstr,1,(one-1)))
  299.         sn=Trim(Mid(bindstr,(one+1)))
  300.         if sn = "255.255.255.255" then
  301.             sn = ""
  302.         end if 
  303.     else
  304.         ip=bindstr
  305.     end if
  306.     getIP=Array(ip,sn)
  307. end function
  308.  
  309.  %>
  310.  
  311.  
  312.  
  313. </SCRIPT>
  314. </BODY>
  315.  
  316. </HTML>
  317. <% end if %>